interface IClassification {
    id?: number
    name?: string
}

interface IGoods {
    categoryId?: number
    detail?: string
    id?: number
    mainImage?: string
    name?: string
    price?: number
    status?: number
    stock?: number
    subImages?: string
    subtitle?: string
}

interface IPageInfo {
    pageSize: number
    pageNum: number
    pageTotal: number
}

interface IHotSearchItem {
    score: number
    value: string
}

interface IRecommendSearchItem {
    score: number
    value: string
}

interface IPhotoList {
    id: number
    photoUrl: string
    productId: number
}

interface ICurrentGoodsDetail {
    id?: number
    name?: string
    stock?: number
    price?: number
    status?: number
    mainImage?: string
    subImages?: string
    subtitle?: string
    sale?: number
    detail?: string
    categoryId?: number
    sysPhotoList?: Array<IPhotoList>
}

interface ISysAttributeValue {
    attributeValue: string
    id: number
    keyId: number
}

interface IAttributeKey {
    attributeName?: string
    categoryId?: number
    id?: number
    sysAttributeValueList?: Array<ISysAttributeValue>
}

export interface ISysProductSpecsVo {
    id: number,
    productId: number,
    productSpecs: any,
    productStock: number,
    productPrice: number
}

interface ICurrentGoodsSpec {
    attributeKeyVos?: Array<IAttributeKey>
    sysProductSpecsVoList?: Array<ISysProductSpecsVo>
}

export interface IState {
    classificationList: Array<IClassification>
    goodsList: Array<IGoods>
    goodsListPageInfo: IPageInfo
    searchGoodsList: Array<IGoods>
    searchGoodsPageInfo: IPageInfo
    hotSearchList?: Array<IHotSearchItem>
    recommendSearchList?: Array<IRecommendSearchItem>
    currentGoodsDetail: ICurrentGoodsDetail
    currentGoodsSpec?: ICurrentGoodsSpec
    currentGoodsStock?: number
}

interface IGetGoodsParams {
    classifyId?: number
    searchCtt?: string
    pageSize?: number
    pageNum?: number
    isMoreMode?: boolean
}

interface ISetGoodsClassify {
    classifyId?: number
    searchCtt?: string
    pageSize?: number
    pageNum?: number
    isMoreMode?: boolean
}

interface ISearchGoodsParams {
    categoryId?: number
    isGlobalSearch?: number
    searchCtt?: string
    pageSize?: number
    pageNum?: number
    orderByColumn?: string
    isDesc?: string
    userId?: number
    isMoreMode?: boolean
}

interface ISetSearchGoodsParams {
    categoryId?: number
    isGlobalSearch?: number
    searchCtt?: string
    pageSize?: number
    pageNum?: number
    orderByColumn?: string
    isDesc?: string
    isMoreMode?: boolean
}

interface IGetGoodsDetail {
    goodsId?: number
}

interface ISetGoodsDetail {
    goodsId?: number
}

interface IGetGoodsSpec {
    goodsId?: number
    categoryId?: number
}

interface ISetGoodsSpec {
    goodsId?: number
    categoryId?: number
}

export interface IActions {
    getGoodsByClassifyAction: (params: IGetGoodsParams) => Promise<any>
    setGoodsClassifyAction: (params: ISetGoodsClassify) => Promise<boolean>
    getClassificationAction: () => Promise<any>
    setClassificationAction: () => Promise<boolean>
    getSearchGoodsAction: (params: ISearchGoodsParams) => Promise<any>
    setSearchGoodsAction: (params: ISetSearchGoodsParams) => Promise<boolean>
    getHotSearchAction: () => Promise<any>
    setHotSearchAction: () => Promise<boolean>
    getRecommendSearch: () => Promise<any>
    setRecommendSearch: () => Promise<boolean>
    getGoodsDetailAction: (params: IGetGoodsDetail) => Promise<any>
    setGoodsDetailAction: (params: ISetGoodsDetail) => Promise<boolean>
    getGoodsSpecAction: (params: IGetGoodsSpec) => Promise<any>
    setGoodsSpecAction: (params: ISetGoodsSpec) => Promise<boolean>
}
